<?php
/**
 * php ACL 通用权限控制类
 * @author Silenus
 */
class ACL {
	
	const ACL_DENY = 0;//禁止
	const ACL_ALLOW = 1;	//允许
	
	function __construct() {
	}
}
interface IAcl {
	
	function __construct() {
	}
	/**
	 */
	function acl_check() {
	}
	function acl_query() 
	{
	}
}
class DatabaseACL extends ACL {
	/**
	 * 
	 * @var db_mysql
	 */
	public $db = NULL;
	/**
	 * 
	 * @var spModel
	 */
	public $model = NULL;
	public $cache = NULL;
	function __construct() {
		parent::__construct ();
	}
	function setDB($db) {
		if (! isset ( $this->db )) {
			$this->db = $db;
		}
		return $this;
	}
	/**
	 * @param  spModel $model
	 * @return DataBaseACL
	 */
	function setModel($model) {
		if (! isset ( $this->model )) {
			$this->model = $model;
		}
		return $this;
	}
	
	function acl_check() {
	}
	function acl_query($hero_id,$condition=array('hero_id'=>'')) {
		$this->db->exec('');
		$this->model->find();
	}
	function undefine($function){
		$function('$parent_id');
	}
}
